<%-- 
    Document   : admin_edit
    Created on : 12 Apr 11, 15:38:23
    Author     : surya
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
    <head>

        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <title>Sweat Bee  by Free CSS Templates</title>
        <meta name="keywords" content="" />
        <meta name="description" content="" />
        <link href="style.css" rel="stylesheet" type="text/css" media="screen" />
        <style type="text/css">
            <!--
            .style1 {font-size: 10px}
            .style2 {color: #000000}
            .style3 {
                font-size: 24px;
                font-weight: bold;
            }
            .style4 {
                font-size: 18px;
                font-weight: bold;
            }
            -->
        </style>
    </head>
    <body>
        <div id="header-wrapper">
            <div id="header">
                <div id="menu">
                    <ul>
                        <li><a href="LoginServlet?admin=logout" class="style1">Logout</a></li>
                        <li><a href="admin_insert.jsp">Insert</a></li>
                        <li><a href="admin_edit.jsp?id_user=all"">Edit</a></li>
                        <li><a href="admin_delete.jsp">Delete</a></li>
                    </ul>
                </div>
                <!-- end #menu -->
                <div id="search">
                    <form method="get" action="">
                        <fieldset>
                            <input type="text" name="s" id="search-text" size="15" />
                            <input type="submit" id="search-submit" value="GO" />
                        </fieldset>
                    </form>
                </div>
                <!-- end #search -->
            </div>
        </div>
        <!-- end #header -->
        <!-- end #header-wrapper -->
        <div id="logo">
            <h1><a href="admin.jsp">Sweat Bee </a></h1>
            <p></p>
        </div>
        <div id="wrapper">
            <div id="page">
                <div id="page-bgtop">
                    <hr />
                    <p>
                        <!-- end #logo -->
                        <span class="style3">Edit Data Pengguna</span></p>
                    <div style="clear: both;">&nbsp;</div>
                </div>
            </div>
            <%
                bean.DataBaseConnection conn = new bean.DataBaseConnection();

                String queryPengguna = "Select * from pengguna ";
                java.sql.Statement stm1 = conn.getConnection().createStatement();
                java.sql.ResultSet getNamaPengguna = stm1.executeQuery(queryPengguna);

                String queryPengguna2 = "Select * from pengguna order by id_user ='" + request.getParameter("id_user") + "' DESC ";
                java.sql.Statement stm2 = conn.getConnection().createStatement();
                java.sql.ResultSet getNamaPenggunaUrut = stm2.executeQuery(queryPengguna2);
            %>
            <div id="page">
                <div id="page-bgtop">
                    <hr />
                    <!-- end #logo -->
                    <div id="content-admin">
                        <div class="post">

                            <div class="entry">
                                <form action="admin_edit.jsp" method="post">
                                    <table width="900" border="0">
                                        <tr>
                                            <th height="48" align="left" scope="row">Id Pengguna</th>
                                            <td colspan="2" align="left">
                                                <select name="id_user" id="id_user">
                                                    <%
                                                        if (request.getParameter("id_user").equals("all")) {
                                                            while (getNamaPengguna.next()) {
                                                    %>
                                                    <option onclick="location.href='admin_edit.jsp?id_user=<%out.print(getNamaPengguna.getString("id_user") + "");%>'"><%out.print(getNamaPengguna.getString("id_user"));%></option>
                                                    <%
                                                        }
                                                    } else {
                                                        while (getNamaPenggunaUrut.next()) {

                                                    %>
                                                    <option onclick="location.href='admin_edit.jsp?id_user=<%out.print(getNamaPenggunaUrut.getString("id_user") + "");%>'"><%out.print(getNamaPenggunaUrut.getString("id_user"));%></option>
                                                    <%
                                                            }
                                                        }
                                                    %>
                                                </select>
                                            </td>
                                        </tr>
                                        <tr>
                                            <th width="136" height="40" align="left" scope="col">Nama Pengguna</th>
                                            <th colspan="2" align="left" scope="col">
                                                <%
                                                    if (request.getParameter("id_user").equals("all")) {
                                                %>
                                                <input type="text" name="user_name" id="user_name">
                                                <%
                                                } else {

                                                %>
                                                <input type="text" name="user_name" id="user_name" value="<%out.print(getNamaPenggunaUrut.getString("user_name"));%>">
                                                <%
                                                    }
                                                %>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th width="136" height="40" align="left" scope="col">Password</th>
                                            <th colspan="2" align="left" scope="col">
                                                <%
                                                    if (request.getParameter("id_user").equals("all")) {
                                                %>
                                                <input type="text" name="password_user" id="password_user">
                                                <%
                                                } else {

                                                %>
                                                <input type="text" name="password_user" id="password_user" value="<%out.print(getNamaPenggunaUrut.getString("password_user"));%>">
                                                <%
                                                    }
                                                %>
                                            </th>
                                        </tr>
                                        <tr>
                                            <th height="54" align="left" scope="row">&nbsp;</th>
                                            <td align="right"><input type="submit" name="Update" id="Update" value="Update"></td>
                                            <td align="right"><input type="reset" name="Cancel" id="Cancel" value="Cancel"></td>
                                        </tr>
                                    </table>
                                </form>
                                <p>&nbsp;</p>
                                <form name="form4" method="post" action="">
                                    <label></label>
                                    <br>
                                </form>
                            </div>
                            <span class="entry">		    </span>
                            <form name="form3" method="post" action="">
                                <label></label>
                            </form>
                            <span class="entry">
                                <p>&nbsp;</p>
                            </span></div>
                    </div>
                    <!-- end #content -->
                    <div style="clear: both;">&nbsp;</div>
                </div>
            </div>
        </div>
        <!-- end #page -->
        <div id="footer-bgcontent">
            <div id="footer">
                <p>Copyright (c) 2008 Sitename.com. All rights reserved. <br />
			Template Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
            </div>
        </div>
        <!-- end #footer -->
    </body>
</html>

